import React, {useState} from "react";
import moment from "moment";
import Demo from "../../components/demo";
import {Link, Switch, RouteWithSubRoutes} from '../../routes/routeUtil'

export default function AntdTest(props) {
    const {routes} = props;
    const [startTime, setStartTime] = useState(moment().set('date', 10));
    const [name, setName] = useState('默认名称');
    return (<div>
        <h2>测试Antd相关功能</h2>
        <div>
            <ul>
                <li>
                    <Link to={'/antd/load'}>按需加载</Link>
                </li>
                <li>
                    <Link to={'/antd/date'}>日期组件</Link>
                </li>
                <li>
                    <Link to={'/antd/theme'}>自定义主题</Link>
                </li>
                <li>
                    <Link to={'/antd/load'}>优化</Link>
                </li>
                <li>
                    <Link to={'/antd/load'}>其他注意</Link>
                </li>

            </ul>
            <div className="container">
                <Switch>
                    {routes.map((route, i) => (
                        <RouteWithSubRoutes key={i} {...route} />
                    ))}
                </Switch>
            </div>
        </div>
    </div>);
}